<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        class Book{
             constructor(id,name,price){
                this.id = id
                this.name = name
                this.price = price
                this.lent()
                console.log("请在规定时间内归还，逾期将赔款" + this.price + "元")
            }·

            sayHello(){
                console.log("你好，同学")
            }

            lent(){
                console.log("编号为" + this.id + "的书本《" + this.name + "》被借走了")
            }
        }
        let b1 = new Book("0137","水浒传","33")
        b1.sayHello()
        console.log(b1)
        let b2 = new Book("3417","三国志","45")
        console.log(b2)
    </script>
</body>
</html>